<template>
	<page class="" v-if="info" ref='page'>
		<view class="imgBox" v-if="info.picture">
			<image :src="info.picture" mode=""></image>
		</view>
		<view class="textBox" v-if="info.content">
			<u-parse :html="info.content" />
		</view>
		<foot></foot>
		<operation type='14' :info='info' v-if='info'></operation>
	</page>
</template>

<script>
	import {setAddLook,setAddShare} from "@/utils/postRequest.js"
	import { getFitmentInfo } from '../static/api.js'
	import operation from '@/pagesHome/operation.vue'
	export default {
		components:{
			operation,
		},
		data() {
			return {
				info:null,
				id:null,
			}
		},
		async onShareAppMessage(res) {
		  await  setAddShare({id:this.id,type:14,isErr:false})
		   this.info.transmit ++ 
		  return {
			title: this.info.title,
			imageUrl: this.$global.shareImg,
			path: `/pagesHome/Processdetails?id=${this.id}&invitation_code=${this.$store.state.userInfo ? this.$store.state.userInfo.invitation_code : ''}`,
		  };
		},
		async onShareTimeline(ops) {
		  await  setAddShare({id:this.id,type:14,isErr:false})
		   this.info.transmit ++ 
		  return {
			title: this.info.title,
			imageUrl: this.$global.shareImg,
			path: `/pagesHome/Processdetails?id=${this.id}&invitation_code=${this.$store.state.userInfo ? this.$store.state.userInfo.invitation_code : ''}`,
		  };
		},
		onLoad(parms) {
			this.id = parms.id
			this.getFitmentInfo(parms.id)
		},
		methods: {
			getFitmentInfo(id){
				uni.showLoading()
				getFitmentInfo({id}).then(res=>{
					this.info = res
					uni.hideLoading()
					setAddLook({id:id,type:14,isErr:false})
					this.$global.$editUploadBack(1,`decoratePowerLook?id=${id}`)
				}).catch(()=>{
					uni.hideLoading()
				})
			}
		},
	}
</script>

<style scoped>
	@import url("./decorateDetail.css");
</style>
